package com.zhou.springcloud.provider.service.impl;

import com.zhou.springcloud.api.pojo.Dept;
import com.zhou.springcloud.provider.dao.DeptMapper;
import com.zhou.springcloud.provider.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhouyongjun
 * @Description:
 * @date 2021/3/20 11:35
 */
@Service
public class DeptServiceImpl implements IDeptService {
    @Autowired
    DeptMapper deptMapper;
    @Override
    public boolean addDept(Dept dept) {
        return deptMapper.insert(dept) > 0;
    }

    @Override
    public Dept queryById(Long id) {
        return deptMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Dept> queryAll() {
        return deptMapper.selectAll();
    }
}
